package cn.smxy.ln.service;

import cn.smxy.ln.common.lang.Result;
import cn.smxy.ln.pojo.College;
import cn.smxy.ln.pojo.Department;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/*
 * @author ln
 * @date 2022-05-20 19:26
 *
 */
@FeignClient(value = "TPA-SPRINGCLOUD-PROVIDER-WORKREGISTER-8010", contextId = "DepartmentService", fallbackFactory = DepartmentServiceFallbackFactory.class)
public interface DepartmentService {

    @GetMapping("/department/list")
    public Result queryBycollegeId(@RequestParam(value = "collegeId", required = false) Long collegeId, @RequestParam(value = "name", required = false) String name);

    @PostMapping("/department/save")
    public Result save(@RequestBody Department department);

    @PostMapping("/department/delete")
    public Result delete(@RequestParam(value = "id") Long id);

    @PostMapping("/department/update")
    public Result update(@RequestBody Department department);
}
